package com.eureka.eurekaserviceinvoker.service;

import com.eureka.eurekaserviceinvoker.entity.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//指定调用spring.application.name为eureka-service-provider的服务
@FeignClient("eureka-service-provider")
public interface BookService {

	/**
	 * 调用书本服务的接口，获取一个Book实例
	 */
	@GetMapping("/book/{bookId}")
	Book getBook(@PathVariable("bookId") Integer bookId);
}
